package com.chinacoal.microservice;


import com.chinacoal.microservice.fallback.MessageManagementClientFallback;
import com.chinacoal.microservice.pojo.CcmsSmartleasingMessage;
import com.chinacoal.microservice.util.QueryCriteria;
import com.chinacoal.microservice.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author zhuliang
 * @version V1.0
 * @Description: 消息管理-对外开发接口
 * @date 2020-12-31 16:40
 */
@Api(tags = {"运维管理-消息管理"})
@FeignClient(name = "${spring.application.name}",fallback = MessageManagementClientFallback.class,configuration = FeignAutoConfiguration.class)
public interface MessageManagementClient {

    /**
     * @Description: 查询所有的消息信息（带分页）
     * @author zhuliang
     * @date 2020/12/31 16:47
     */
    @ApiOperation(value = "查询所有的消息信息（带分页）")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "queryCriteria", value = "查询条件实体类", required = true, dataType = "QueryCriteria"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
    @PostMapping("smartleasing/messageManagement/getAllByPage")
    public Result<List<CcmsSmartleasingMessage>> getAllByPage(@RequestBody QueryCriteria queryCriteria,
                                                              @RequestHeader("token") String token);

    /**
     * @Description: 条件查询所有的消息信息（带分页）
     * @author zhuliang
     * @date 2020/12/31 16:48
     */
    @ApiOperation(value = "条件查询所有的消息信息（带分页）")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "queryCriteria", value = "查询条件实体类", required = true, dataType = "QueryCriteria"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
    @PostMapping("smartleasing/messageManagement/getAllByCondition")
    public Result<List<CcmsSmartleasingMessage>> getAllByCondition(@RequestBody QueryCriteria queryCriteria,
                                                                   @RequestHeader("token") String token);
}
